import { useSelector, useDispatch } from "react-redux";
import { RootState } from "../../store";
import { Button } from "antd-mobile";
import { increment } from "../../store/features/count";
export interface ICompAProps {}

export default function CompA(props: ICompAProps) {
  const { count, movie } = useSelector((state: RootState) => state);
  const dispatch = useDispatch();
  console.log("状态机数据", count);

  return (
    <div>
      <h1>A组件,{count.num}</h1>
      <Button
        color="primary"
        onClick={() => {
          dispatch(increment());
        }}
      >
        +
      </Button>
      {movie.list.map((item: any) => {
        return <div>{item.name}</div>;
      })}
    </div>
  );
}
